home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / DOSTRAP.H < prev    next >
C/C++ Source or Header  |  1992-05-05  |  3KB  |  96 lines

  1. /* -*-C-*-
  2.  
  3. $Header: /scheme/dos386/microcode/RCS/dostrap.h,v 1.1 1992/05/05 06:55:13 jinx Exp $
  4.  
  5. Copyright (c) 1992 Massachusetts Institute of Technology
  6.  
  7. This material was developed by the Scheme project at the Massachusetts
  8. Institute of Technology, Department of Electrical Engineering and
  9. Computer Science.  Permission to copy this software, to redistribute
  10. it, and to use it for any purpose is granted, subject to the following
  11. restrictions and understandings.
  12.  
  13. 1. Any copy made of this software must include this copyright notice
  14. in full.
  15.  
  16. 2. Users of this software agree to make their best efforts (a) to
  17. return to the MIT Scheme project any improvements or extensions that
  18. they make, so that these may be included in future releases; and (b)
  19. to inform MIT of noteworthy uses of this software.
  20.  
  21. 3. All materials developed as a consequence of the use of this
  22. software shall duly acknowledge such use, in accordance with the usual
  23. standards of acknowledging credit in academic research.
  24.  
  25. 4. MIT has made no warrantee or representation that the operation of
  26. this software will be error-free, and MIT is under no obligation to
  27. provide any services, by way of maintenance, update, or otherwise.
  28.  
  29. 5. In conjunction with products arising from the use of this material,
  30. there shall be no use of the name of the Massachusetts Institute of
  31. Technology nor of any adaptation thereof in any advertising,
  32. promotional, or sales literature without prior written consent from
  33. MIT in each case. */
  34.  
  35. #ifndef SCM_DOSTRAP_H
  36. #define SCM_DOSTRAP_H
  37.  
  38. #ifndef SIGINFO_T
  39. #define SIGINFO_T unsigned
  40. #define SIGINFO_VALID_P(info) (1)
  41. #define SIGINFO_CODE(info) (info)
  42. #endif
  43.  
  44. /* EIP not included here, not a "register", except on the Vax.
  45.    8 General registers.
  46.    6 Segment registers.
  47.    1 Flags   register.
  48.  */
  49.  
  50. #define HAVE_SIGCONTEXT
  51. #define HAVE_FULL_SIGCONTEXT
  52. #define PROCESSOR_NREGS            (8 + 6 + 1)
  53. #define FULL_SIGCONTEXT_NREGS        PROCESSOR_NREGS
  54.  
  55. #define SIGCONTEXT            sigcontext
  56. #define SIGCONTEXT_SP(scp)        ((scp)->sc_esp)
  57. #define SIGCONTEXT_PC(scp)        ((scp)->sc_eip)
  58.  
  59. #define FULL_SIGCONTEXT            SIGCONTEXT
  60. #define FULL_SIGCONTEXT_SP        SIGCONTEXT_SP
  61. #define FULL_SIGCONTEXT_PC        SIGCONTEXT_PC
  62. #define FULL_SIGCONTEXT_RFREE(scp)    ((scp)->sc_edi)
  63. #define FULL_SIGCONTEXT_FIRST_REG(scp)    (& (scp->sc_eax))
  64. #define FULL_SIGCONTEXT_SCHSP        FULL_SIGCONTEXT_SP
  65.  
  66. #define DECLARE_FULL_SIGCONTEXT(name)                    \
  67.   struct FULL_SIGCONTEXT * name
  68.  
  69. #define INITIALIZE_FULL_SIGCONTEXT(partial, full)            \
  70.   ((full) = ((struct FULL_SIGCONTEXT *) (partial)))
  71.  
  72. #define INVALID_TRAP            -1
  73.  
  74. enum trap_state
  75. {
  76.   trap_state_trapped,
  77.   trap_state_exit,
  78.   trap_state_suspend,
  79.   trap_state_query,
  80.   trap_state_recover,
  81.   trap_state_exitting_soft,
  82.   trap_state_exitting_hard
  83. };
  84.  
  85. extern enum trap_state EXFUN (OS_set_trap_state, (enum trap_state state));
  86. extern void EXFUN
  87.   (trap_handler,
  88.    (CONST char * message,
  89.     int signo,
  90.     SIGINFO_T info,
  91.     struct FULL_SIGCONTEXT * scp));
  92. extern void EXFUN (hard_reset, (struct FULL_SIGCONTEXT * scp));
  93. extern void EXFUN (soft_reset, (void));
  94.  
  95. #endif /* SCM_DOSTRAP_H */
  96.